{% extends 'basic_app/master.html' %}
{% block tag_left %}
    {% include 'basic_app/tag_left_user.html' %}
{% endblock %}
{% block userinfo %}
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <h2 class="page-header">编辑实例页</h2>
        <form class="form-horizontal" action="/basic_app/instance_edit"   method="post">
            <div class="form-group" style="display:none" >
                <label  class="col-sm-2 control-label">id：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  placeholder="id" name="v_id" value={{ instanceinfo_result.id }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">Username：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  placeholder="主机名" name="add_hostname" value={{ instanceinfo_result.hostname }} >
                </div>
            </div>
                        <div class="form-group">
                <label  class="col-sm-2 control-label">Dbname：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  placeholder="数据库名" name="add_dbname" value={{ instanceinfo_result.dbname }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">Ip：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="IP"  name="add_ip" value={{ instanceinfo_result.ip }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">Port：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="端口" name="add_port" value={{ instanceinfo_result.port }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">Sid：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="实例名"  name="add_sid" value={{ instanceinfo_result.sid }}>
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">conn_string：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="连接串"  name="add_conn_string" value={{ instanceinfo_result.conn_string }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">status：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="状态" name="add_status" value={{ instanceinfo_result.status }}>
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">Remake：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="备注" name="add_remake" value={{ instanceinfo_result.remake }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">type：</label>
                <div class="col-sm-10">
                    <select class="form-control" id="type_select"    name="add_type" type= {{ instanceinfo_result.type }}>
                        <option>ORACLE</option>
                        <option>MYSQL</option>
                    </select>
                </div>
            </div>
            <div class="col-sm-10">
                <div style="text-align:center;vertical-align:middle;"><button type="submit" class="btn ">提交</button></div>
            </div>
        </form>
    </div>
{% endblock  %}
{% block script %}
    <script>
        window.onload=function(){
            var type_set = document.getElementById("type_select").getAttribute("type");
            document.getElementById("type_select").value=type_set}
    </script>
{% endblock %}